﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.User
{
    public partial class add_user : System.Web.UI.Page
    {
        public int id;
        protected void Page_Load(object sender, EventArgs e)
        {
            int level = int.Parse(Request.QueryString["level"]);
            string number = Request.QueryString["number"];
            string username = Request.QueryString["username"];
            string fullname = Request.QueryString["fullname"];
            string email = Request.QueryString["email"];
            string phone = Request.QueryString["phone"];
            int city = int.Parse(Request.QueryString["city"]);
            string address = Request.QueryString["address"];
            int sex = int.Parse(Request.QueryString["sex"]);
            bool check_sex = true;
            if (sex == 0)
                check_sex = false;
            DateTime birthday = DateTime.Parse(Request.QueryString["birthday"]);
            new TblUserController().Insert(number.ToUpper(), username.ToLower(), "sqt123456789", fullname, birthday, phone, "userpic.png", email, address, city, "", check_sex, level, 0, true, DateTime.Now, "headerbanner.jpg", "");
            var get_last = new TblUserController().FetchAll().Last();
            id = get_last.UserId;
        }
    }
}